#include<iostream>
#include"ThreadPool.hpp"
#include"Task.hpp"
#include<time.h>
int main()
{
    srand(time(nullptr));
     ThreadPool<Task>* ptr=ThreadPool<Task>::GetInstance();
    std::cout<<"1" << std::endl;;
    ptr->Start();//线程池跑起来
    while(true)
    {
        //1.获取数据 2.push到任务队列
        int x=rand()%10+1;
        int y=rand()%10;
        Task t(x,y,opers[rand()%opers.size()]);
        ptr->Push(t);
        std::cout<<"Add a task !task is: "<<t.GetTask()<<std::endl;
        sleep(1);
    }
    return 0;
}